<extend name="Layout/dialog" />
<block name="css"></block>
<block name="style"></block>
<block name="js"></block>
<block name="script">
<script>
$(function(){
	$("#hide").hide();
	$("select").change(function(){
		$(this).val()=="0" ? $("#hide").hide() : $("#hide").show();
	});
});
</script>
</block>
<block name="model">账户管理</block>
<block name="controller">权限管理</block>
<block name="action">新增权限</block>
<block name="desc"></block>
<block name="content">
<div class="box box-success">
	<div class="box-header with-border">
		<h3 class="box-title">新增权限</h3>
	</div>
	<form class="form-horizontal" action="{:U('save')}" method="post" rel-action="form" rel-success="reload()">
	<div class="box-body">
		<div class="form-group">
			<label class="col-sm-2 control-label"><span class="text-red">*</span>所属分类</label>
			<div class="col-sm-10">
				<select class="form-control" rel-action="select" name="pid">
					<option value="0">作为顶级分类</option>
					<volist name="level" id="item">
						<option value="{$item.level_id}">{$item.level_name}</option>
					</volist>
				</select>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label"><span class="text-red">*</span>标题</label>
			<div class="col-sm-10">
				<input type="text" class="form-control" name="name" placeholder="请输入标题"  autocomplete="off">
			</div>
		</div>
		<div id="hide">
		<div class="form-group">
			<label class="col-sm-2 control-label"><span class="text-red">*</span>标识</label>
			<div class="col-sm-10">
				<input type="text" class="form-control" name="data" placeholder="请输入地址：如：/Admin/Acount/password"  autocomplete="off">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label">默认</label>
			<div class="col-sm-10 radio">
				<label><input type="radio" name="default" value="1">启用</label>
				<label><input type="radio" name="default" value="0" checked="checked">禁用</label>
			</div>
		</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label">描述</label>
			<div class="col-sm-10">
				<input type="text" class="form-control" name="desc" placeholder="请输入描述"  autocomplete="off">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label">排序</label>
			<div class="col-sm-10">
				<input type="number" class="form-control" name="order" placeholder="请填写整数，数字越小越靠前" autocomplete="off">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label">状态</label>
			<div class="col-sm-10 radio">
				<label><input type="radio" name="state" value="1" checked="checked">正常</label>
				<label><input type="radio" name="state" value="0">锁定</label>
			</div>
		</div>
	</div>
	<div class="box-footer">
		<div class="col-sm-offset-2 col-sm-10">
			<button type="submit" class="btn btn-default">保存</button>
			<button type="button" class="btn btn-default" rel-action="dialog-close">关闭</button>
		</div>
	</div>
	</form>
</div>
</block>